export default {
	data() {
		return {
			defaultBanner: [{
				"des": "静态图片",
				"image": "/static/banner.png",
				"path": "",
				"type": "image"
			}],
			defaultIndexList: [{
					"color": "linear-gradient(to right, #FE8181, #FF6D6D)",
					"desc": "会员版去水印免广告",
					"icon": "/static/index/3.png",
					"path": "https://mp.weixin.qq.com/s/04-FSxZPTJ-pDUrz6_HpCg",
					"title": "专属会员",
					"type": "link"
				},
				{
					"color": "linear-gradient(to right, #FFBE0D, #F7CB6B)",
					"desc": "完成任务得限时会员",
					"icon": "/static/index/2.png",
					"path": "/pages/task/task",
					"title": "完成任务",
					"type": "switchTab"
				},
				{
					"color": "linear-gradient(to right,#2fb9ff,#0a98ff)",
					"desc": "查看解析记录",
					"icon": "/static/index/4.png",
					"path": "/subpages/record/record",
					"title": "解析记录",
					"type": "nav"
				},
				{
					"color": "linear-gradient(to right, #9769FF, #7C59FF)",
					"desc": "学习如何去水印",
					"icon": "/static/index/1.png",
					"path": "/subpages/study/study",
					"title": "使用教程",
					"type": "nav"
				}
			],
			adsSeat: {
				"detail_ft": "adunit-b3273633baa75f45",
				"detail_video": "adunit-e9183e1649895311",
				"index_ft": "adunit-f2e454d4bb68c2be",
				"mine_ft": "adunit-68171ea811f16aba",
				"more_ft": "adunit-a2eeeb0fd6771f21",
				"record_tp": "adunit-3830930d2bf5dd29",
				"study_hd": "adunit-58e8913818699b3f",
				"task_ft": "adunit-714fd1c5f4a18cee"
			},
			adsDown: {
				"code": [
					1004,
					1005,
					1006,
					1007,
					1008
				],
				"count": 2,
				"count_free": 0,
				"id": "adunit-2eb1c8a79a49a1f6",
				"msg": "限时活动：分享好友即可自动获得会员。支持D音微博小红书等200多个平台原图无水印下载。点击观看广告，观看完成，即可下载，一天只需看2次，",
				"open": true
			},
			adsInter: {
				"id": "adunit-ff5d11704dfee013",
				"max_count": 2,
				"open": true,
				"time": 15000
			},
			adsTask: {
				"count": 2,
				"day": 1,
				"id": "adunit-2eb1c8a79a49a1f6",
				"open": true
			},
			downloadUrls: {
				"image1_url": "https://www.yundaduo.com/wechat_applet/down/pic",
				"video1_url": "https://test.yundaduo.com/wechat_applet/down/video"
			},
			taskNew: {
				"open": true,
				"path": "https://mp.weixin.qq.com/s/vpfvQKHgB_bfGuvipW_GMw",
				"title": "关注公众号领取会员+10倍加速下载权限+更多限时福利",
				"type": "link"
			},
			taskShare: {
				"day": 0.5,
				"long_vip_people": -1,
				"open": true,
				"people": 1
			},
			otherH5: {
				"activity_index": {
					"open": true,
					"path": "https://mp.weixin.qq.com/s/vpfvQKHgB_bfGuvipW_GMw",
					"title": "关注公众号，免费领取会员下载免广告，下载加速",
					"type": "link"
				},
				"detail_recommend": {
					"open": true,
					"path": "https://mp.weixin.qq.com/s/04-FSxZPTJ-pDUrz6_HpCg",
					"title": "不想看广告？点击获取无广告纯净版",
					"type": "link"
				},
				"popup_vip": {
					"again_day": 3,
					"day": 2,
					"open": true,
					"path": "https://mp.weixin.qq.com/s/vpfvQKHgB_bfGuvipW_GMw",
					"type": "link"
				},
				"question": {
					"open": true,
					"title": "智绘网络科技",
					"url": "https://mp.weixin.qq.com/s/vvNAFuaoYbVVTUxFhuGzNw"
				}
			},
			logsStatus: {
				"ad_error_log": true,
				"download_error_log": false,
				"download_success_log": false
			}
		}
	},
	computed: {
		banner: {
			get(val) {
				if (this.formData.index_banner.length) {
					return JSON.stringify(this.formData.index_banner)
				} else {
					this.formData.index_banner = this.defaultBanner;
					return JSON.stringify(this.defaultBanner);
				}
			},
			set(newVal) {
				this.formData.index_banner = JSON.parse(newVal);
			}
		},
		indexList: {
			get(val) {
				if (this.formData.index_list.length) {
					return JSON.stringify(this.formData.index_list)
				} else {
					this.formData.index_list = this.defaultIndexList;
					return JSON.stringify(this.defaultIndexList);
				}

			},
			set(newVal) {
				this.formData.index_list = JSON.parse(newVal);
			}
		},
		ads_seat: {
			get(val) {
				if (this.formData.ads_seat) {
					return JSON.stringify(this.formData.ads_seat ?? this.adsSeat);
				} else {
					this.formData.ads_seat = this.adsSeat;
					return JSON.stringify(this.adsSeat);
				}
			},
			set(newVal) {
				this.formData.ads_seat = JSON.parse(newVal);
			}
		},
		ads_down: {
			get(val) {
				if (this.formData.ads_down) {
					return JSON.stringify(this.formData.ads_down);
				} else {
					this.formData.ads_down = this.adsDown;
					return JSON.stringify(this.adsDown);
				}
			},
			set(newVal) {
				this.formData.ads_down = JSON.parse(newVal);
			}
		},
		ads_inter: {
			get(val) {
				if (this.formData.ads_inter) {
					return JSON.stringify(this.formData.ads_inter);
				} else {
					this.formData.ads_inter = this.adsInter;
					return JSON.stringify(this.adsInter);
				}
			},
			set(newVal) {
				this.formData.ads_inter = JSON.parse(newVal);
			}
		},
		ads_task: {
			get(val) {
				if (this.formData.ads_task) {
					return JSON.stringify(this.formData.ads_task);
				} else {
					this.formData.ads_task = this.adsTask;
					return JSON.stringify(this.adsTask);
				}
			},
			set(newVal) {
				this.formData.ads_task = JSON.parse(newVal);
			}
		},
		download: {
			get(val) {
				if (this.formData.download) {
					return JSON.stringify(this.formData.download);
				} else {
					this.formData.download = this.downloadUrls;
					return JSON.stringify(this.downloadUrls);
				}
			},
			set(newVal) {
				this.formData.download = JSON.parse(newVal);
			}
		},
		task_new: {
			get(val) {
				if (this.formData.task_new) {
					return JSON.stringify(this.formData.task_new);
				} else {
					this.formData.task_new = this.taskNew;
					return JSON.stringify(this.taskNew);
				}
			},
			set(newVal) {
				this.formData.task_new = JSON.parse(newVal);
			}
		},
		task_share: {
			get(val) {
				if (this.formData.task_share) {
					return JSON.stringify(this.formData.task_share);
				} else {
					this.formData.task_share = this.taskShare;
					return JSON.stringify(this.taskShare);
				}
			},
			set(newVal) {
				this.formData.task_share = JSON.parse(newVal);
			}
		},
		h5: {
			get(val) {
				if (this.formData.h5) {
					return JSON.stringify(this.formData.h5);
				} else {
					this.formData.h5 = this.otherH5;
					return JSON.stringify(this.otherH5);
				}
			},
			set(newVal) {
				this.formData.h5 = JSON.parse(newVal);
			}
		},
		logs: {
			get(val) {
				if (this.formData.logs) {
					return JSON.stringify(this.formData.logs);
				} else {
					this.formData.logs = this.logsStatus;
					return JSON.stringify(this.logsStatus);
				}
			},
			set(newVal) {
				this.formData.logs = JSON.parse(newVal);
			}
		}
	},
	methods: {
		binddata(label,value) {
			this.formData[label] = value;
		}
	}
}